//
//  lunboTableViewCell.m
//  lmq
//
//  Created by 千翼网络科技 on 2017/1/13.
//  Copyright © 2017年 yuanxin. All rights reserved.
//

#import "lunboTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation lunboTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor=DEF_RGB_COLOR(202, 202, 202);
        
        self.backView=[[UIView alloc]initWithFrame:CGRectMake(0,0, DEF_SCREEN_WIDTH, (200))];
        self.backView.backgroundColor=[UIColor redColor];
        [self addSubview:self.backView];

        NSArray *arrMu = @[@"niunai",@"niunai",@"niunai",@"niunai",@"niunai"];
        self.cycleScrollView=[SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, DEF_SCREEN_WIDTH, (200)) imageNamesGroup:arrMu];
        self.cycleScrollView.backgroundColor=[UIColor whiteColor];
        self.cycleScrollView.pageControlAliment=SDCycleScrollViewPageContolAlimentCenter;
        self.cycleScrollView.delegate = self;
        self.cycleScrollView.pageDotColor = [UIColor grayColor]; // 自定义分页控件小圆标颜色
        self.cycleScrollView.currentPageDotImage=[UIImage imageNamed:@"hei"];
        self.cycleScrollView.pageDotImage=[UIImage imageNamed:@"hui"];
        self.cycleScrollView.placeholderImage = [UIImage imageNamed:@""];
        [self.backView addSubview:self.cycleScrollView];

    }
    return self;
}

#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
    NSLog(@"---点击了第%ld张图片", index);
    
    //    NSDictionary *dict=arrLunbo[index];
    //    NSString *str1=[dict objectForKey:@"height"];
    //    NSString *str2=[dict objectForKey:@"src"];
    //    NSString *str3=[dict objectForKey:@"url"];
    //    NSString *str4=[dict objectForKey:@"width"];
    
//    webViewController *vc=[[webViewController alloc]init];
//    vc.requestURL=@"http://www.baidu.com";
//    vc.requestURLTitle=@"商品详情";
//    vc.hidesBottomBarWhenPushed=YES;
//    [self.navigationController pushViewController:vc animated:YES];
}

-(void)updateInfo:(NSArray*)SDCycleArr{
    NSMutableArray *myarr=[[NSMutableArray alloc]init];
    for (int i=0; i<SDCycleArr.count; i++) {
        
        NSString *str=[SDCycleArr[i] objectForKey:@"pic"];
        NSString *urlN=manage(AP_HOST, str);
        NSString *strUrl = [urlN stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
        [myarr addObject:strUrl];
    }
    [self.cycleScrollView setLocalizationImageNamesGroup:myarr];
    [self.cycleScrollView reloadInputViews];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
